/*
 * @Description: 你的代码我的心
 * @Author: GGB
 * @Date: 2022-01-25 14:33:01
 * @LastEditors: GGB
 * @LastEditTime: 2022-01-25 17:17:57
 */
/*
 * @Description: 你的代码我的心
 * @Author: GGB
 * @Date: 2022-01-25 10:40:18
 * @LastEditors: GGB
 * @LastEditTime: 2022-01-25 10:54:45
 */
import {
  MenuListGetResultModel,
  MenuParams,
  DeleteMenuParams,
  DetailMenuParams,
  BindApiMenuParams,
} from './model/menuModel';
import { defHttp } from '/@/utils/http/axios';

import { BasicPageParams, BasicResult } from '../model/baseModel';

enum Menu {
  MenuList = '/store.menu/index',
  AddMenu = '/store.menu/add',
  EditMenu = '/store.menu/edit',
  DeleteMenu = '/store.menu/delete',
  MenuDetail = '/store.menu/info',
  MenuBindApi = '/store.menu/setApis',
}
/**
 * 获取菜单权限列表
 */
export const getMenuList = (params: BasicPageParams) =>
  defHttp.get<MenuListGetResultModel>({ url: Menu.MenuList, params });

/**
 * 新增菜单权限
 */
export const addMenu = (params: MenuParams) =>
  defHttp.post<BasicResult>({ url: Menu.AddMenu, params });

/**
 * 编辑菜单权限
 */
export const editMenu = (params: MenuParams) =>
  defHttp.post<BasicResult>({ url: Menu.EditMenu, params });

/**
 * 删除菜单权限
 */
export const deleteMenu = (params: DeleteMenuParams) =>
  defHttp.post<BasicResult>({ url: Menu.DeleteMenu, params });

/**
 * 获取菜单权限信息
 */
export const detailMenu = (params: DetailMenuParams) =>
  defHttp.post<BasicResult>({ url: Menu.MenuDetail, params });
/**
 * 获取菜单权限信息
 */
export const bindApiMenu = (params: BindApiMenuParams) =>
  defHttp.post<BasicResult>({ url: Menu.MenuBindApi, params });
